#include "../net/unix_client.hpp"
#define UNIX_PATH   "hello"
#include <string_view>
#include <iostream>
using namespace std;

int main()
{
    unix_client client(UNIX_PATH);
    client.connect();
    int fd = client.get_sockfd();
    printf("fd: %d\n", fd);
    char buf[4000];
    string_view msg[] = {
        "hello", "world", "lixiang"
    };
    for (int i = 0; i < 3; i++){
        send(fd, msg[i].data(), msg[i].size() + 1, 0);
        int n = recv(fd, buf, sizeof(buf), 0);
        printf("n:%d %s\n", n, buf);
        
    }
    return 0;
}